//
//  ZYXPhotoView.m
//  RuiBeiKang
//
//  Created by 代码女神 on 2019/1/10.
//  Copyright © 2019年 JW. All rights reserved.
//

#import "ZYXPhotoView.h"
#import "UIView+coordinates.h"

@interface ZYXPhotoView()

@property (weak, nonatomic) IBOutlet UIView *emptyView;
@property (weak, nonatomic) IBOutlet UIButton *photoBtn;
@property (weak, nonatomic) IBOutlet UIButton *albumBtn;
@property (weak, nonatomic) IBOutlet UIButton *cancelBtn;
@property (weak, nonatomic) IBOutlet UIView *buttonBgView;

@end

@implementation ZYXPhotoView

- (void)awakeFromNib{
    [super awakeFromNib];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cancelAction:)];
    [self.emptyView addGestureRecognizer:tap];
    
    self.cancelBtn.layer.cornerRadius = 5.f;
    self.cancelBtn.layer.masksToBounds = YES;
    self.buttonBgView.layer.cornerRadius = 5.f;
    self.buttonBgView.layer.masksToBounds = YES;
}

#pragma mark Action
- (IBAction)cancelAction:(id)sender {
    self.hidden = YES;
}
- (IBAction)photoAction:(id)sender {
    self.hidden = YES;
    [self.delegate didClickTakePhoto];
}
- (IBAction)albumAction:(id)sender {
    self.hidden = YES;
    [self.delegate didClickAlbum];
}

@end
